
<span class="user-control">
  <?php if ( $sf_user->isAuthenticated() ): ?>

      You are logged in as
      <?php $name = $sf_user->getGuardUser()->getFirstName() . ' ' . $sf_user->getGuardUser()->getLastName(); ?>
      <?php echo $route == 'account' ? '<span>' . $name . '</span>' : link_to( $name, '@homepage' ); ?>
      [ <?php echo link_to( 'Logout', '@sf_guard_signout' ); ?> ]

  <?php else: ?>

    <?php if ( $route == 'sf_guard_register' ): ?>
      Create Account
    <?php else: ?>
      <?php echo link_to( 'Create account', '@sf_guard_register' ); ?>
    <?php endif; ?>
    |
    <?php if ( $route == 'sf_guard_signin' ): ?>
      Login
    <?php else: ?>
      <?php echo link_to( 'Login', '@sf_guard_signin' ); ?>
    <?php endif; ?>

  <?php endif; ?>
</span>
